package com.example.circleview;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;

public class MainActivity extends Activity {

	protected ImageLoader imageLoader = ImageLoader.getInstance();
	DisplayImageOptions options;
	ImageView iv1;
	ImageView iv2;
	ImageView iv3;
	String url = "http://res01.mimg.ifeng.com/g?url=http://img.ifeng.com/itvimg//2013/04/16/09b70399-cbbb-42ab-b5b3-7dda4f9986af130.jpg&w=160&h=-1&v=e48f27f607&r=1";
	String url2 = "http://res01.mimg.ifeng.com/g?url=http://d.ifengimg.com/w480_h360/y0.ifengimg.com/pmop/storage_img/2013/09/23/7eeb3204-bcc5-4f59-89ff-5635d66315d4157.jpg&w=160&h=-1&v=298994eff4&r=1";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		iv1 = (ImageView) findViewById(R.id.iv1);
		iv2 = (ImageView) findViewById(R.id.iv2);
		iv3 = (ImageView) findViewById(R.id.iv3);

		options = new DisplayImageOptions.Builder()
				.showImageForEmptyUri(R.drawable.ic_empty)
//				.showImageOnFail(R.drawable.ic_error).cacheInMemory(true)
				.cacheOnDisc(true).displayer(new RoundedBitmapDisplayer(20))
				.build();

		imageLoader.displayImage(url, iv1, options);
		imageLoader.displayImage(url, iv2, options);
		imageLoader.displayImage(url, iv3, options);
	}

}
